<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoldEndsTable extends Migration
{
    public function up()
    {
        Schema::create('gold_ends', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('gold_round_id')->default(0)->index();
            $table->unsignedBigInteger('gold_product_id')->default(0)->unique();
            $table->dateTime('ended_at')->nullable()->index();
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('gold_ends');
    }
}
